package com.workcell.workdata.xthings.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.workcell.workdata.xthings.dto.BindInfoDto;
import com.workcell.workdata.xthings.dto.DeviceBindDto;
import com.workcell.workdata.xthings.dto.DeviceReplaceVo;
import com.workcell.workdata.xthings.entity.CodeChainnum;
import com.workcell.workdata.xthings.entity.DeviceBind;

import java.util.List;

/**
 * @author Admin
 * @description 针对表【t_device_bind(设备绑定表)】的数据库操作Service
 * @createDate 2023-03-17 18:28:56
 */
public interface DeviceBindService extends IService<DeviceBind> {

    DeviceBind getOne(DeviceBind deviceBind);

    List<DeviceBind> list(DeviceBind deviceBind);

    /**
     * 设备绑定
     *
     * @param deviceBind
     * @return
     */
    boolean bind(DeviceBind deviceBind);

    /**
     * 设备解绑
     *
     * @param deviceBind
     * @return
     */
    boolean unbind(DeviceBind deviceBind);

    List<CodeChainnum> bindList2(String deviceNo, String hardwareType);

    BindInfoDto getBindInfo(String masterDeviceNo, String addressId);

    List<CodeChainnum> bindList2(String chainNum);

    List<DeviceBindDto> allBindList();

	/**
	 * 把当前所有串口信息的执行任务推送至kafka
	 */
	void sendModbusJobToKafka();

    boolean replace(DeviceReplaceVo deviceReplaceVo);

    /**
     * 根据设备编号 删除绑定关系
     * @param deviceNo
     * @return
     */
    boolean removeByDeviceNo(String deviceNo);

	DeviceBindDto getBindInfoByDeviceNo(String deviceNo,String queryType);

}
